package com.wsl.demo.controller;

import com.wsl.demo.config.AccessLimit;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/test")
public class TestApi {

    @GetMapping("/common")
    public String common(){
        return "测试成功";
    }


    @GetMapping("/limitAccess")
    @AccessLimit(time = 1,timeUnit = TimeUnit.MINUTES,maxCount = 3,msg = "您已超过最大次数")
    public String limitAccess(){
        return "测添加限制，试成功";
    }

}
